@extends('admin.layout.index')
@section('content')
<div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="card">
                        <div class="card-action">
                             {{ $goodsname }}
                        </div>
                    
                        <div class="card-content">
                            <div class="table-responsive">
                                <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline" role="grid">
                                	<div class="row">
                                		<form action="/admin/goods/reviews" method="get">
                                                
                                               <input type="hidden" name="gid" value={{ $request['gid'] }}>



                                		<div class="col-sm-3">
                                			<div class="dataTables_length" id="dataTables-example_length"><label>
                                				<select name="dataTables-example_length" aria-controls="dataTables-example" class="form-control input-sm">
                                					<option value="10" @if(!empty($request['dataTables-example_length']) && $request['dataTables-example_length'] == 10 ) selected @endif>10</option>
                                					
                                					<option value="20" @if(!empty($request['dataTables-example_length']) && $request['dataTables-example_length'] == 20 ) selected @endif>20</option>
                                					
                                					<option value="30" @if(!empty($request['dataTables-example_length']) && $request['dataTables-example_length'] == 30 ) selected @endif>30</option>
                                					
                                				</select> records per page</label>
                                                
                                			</div>
</div>
<div class="col-sm-3">
          
   
</div>



                                                <input type="hidden" name="n" value="{{ $request['n'] or 'id' }}">
                                		
                                		<div class="col-sm-6">
                                			<div id="dataTables-example_filter" class="dataTables_filter">
                                				<label>用户名:
                                					<input type="search" name="search" class="form-control input-sm" value="{{ $request['search'] or '' }}" aria-controls="dataTables-example">
                                				</label>
                                				<button type="submit" class="btn btn-default"> 搜索 </button>
                                				
                                			</div>
                                       
                                		</form>
                                   
                                			<a href="/admin/goods/reviews?n=id&gid={{ $request['gid'] }}" @if(empty($request['n'])) style="text-decoration:underline" @endif  @if(!empty($request['n']) && $request['n'] == 'id') style="text-decoration:underline" @endif> 默认排序 </a>
                                		
                                			
                                            |
                                            <a href="/admin/goods/reviews?n=score&gid={{ $request['gid'] }}" @if(!empty($request['n']) && $request['n'] == 'score') style="text-decoration:underline" @endif> 评分排序 </a>
                                        
                                			
                                			|
                                			<a href="/admin/goods/reviews?n=ctime&gid={{ $request['gid'] }}" @if(!empty($request['n']) && $request['n'] == 'ctime') style="text-decoration:underline" @endif> 时间排序 </a>
                                	
                                        </div>
                                		</div>
                                	</div>
                                         <!-- =======编辑的弹窗============= -->

        <div id="my_create" class="input-field col s12" style="display:none;position: fixed;left:400px;top:200px;background:#F5F5F5;height:50px;width:750px">
            
          <input id="my_classified" type="text" style="width:500px;font-weight:bold;" class="validate">
          <label for="my_classified" class="active">
            <font size="3"><i id="my_reminder"> 修改xxx的评论 </i>
          </font> 请输入你要编辑的内容</label>
                <button type="submit" class="btn btn-primary" info="send"> 确认编辑 </button>
                <button type="submit" class="btn btn-default" info="close"> 取消编辑 </button>
          
        </div>
                 <!-- ==================== -->
                                	<table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example" aria-describedby="dataTables-example_info">
                                    <thead>
                                        <tr role="row">
                                        	<th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column ascending" style="width: 300px;">用户信息
                                        	</th>
                                        	<th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 150px;">评论状态
                                        </th>
                                        	
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 136px;">评分
                                        </th>
                                        
                                        
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 300px;">评论时间
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 300px;">评论内容
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 350px;">操作
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
             						@foreach($data as $v)
                                    <tr class="gradeA odd" @if($v['status'] == 1) style="background:#F2DEDE" @endif>
                                            <td class="sorting_1" style="height:200px;line-height:200px"><a href="/admin/user/userdetail?id={{ $v['uid'] }}">{{ $v['writer'] }}</a></td>             
                                            <td class=" " change="show" style="height:200px;line-height:200px">@if( $v['status'] == 0 )正常@else 屏蔽中@endif</td>
                                            <td class=" " style="height:200px;line-height:200px">{{ $v['score'] }}</td>
                                            <td class=" " style="height:200px;line-height:200px">{{ date('Y-m-d h:i:s',$v['ctime']) }}</td>
                                            <td class="">{{ $v['content'] }}</td>
                                            <td class="center " style="height:200px;line-height:200px">
                                            	<a href="javascript:;"  card="{{ $v['id'] }}" onclick="mydel(this)" >删除</a>
                                            	|
                                            	<a href="javascript:;" info="status" status="{{ $v['status'] }}" card="{{ $v['id'] }}" onclick="fun(this)">@if($v['status'] == 0)屏蔽@else显示@endif</a>
                                            	|
                                            	<a href="javascript:;" card="{{ $v['id'] }}" writer="{{ $v['writer'] }}" text="{{ $v['content'] }}" onclick="edit(this)" >编辑</a>
                                                |
                                                <a href="/admin/goods/toview?id={{ $v['id'] }}">详情</a>
                                            </td>
                                        </tr>
									@endforeach
                                    </tbody>
                                </table><div class="row"><div class="col-sm-6"><div class="dataTables_info" id="dataTables-example_info" role="alert" aria-live="polite" aria-relevant="all">Showing 1 to 10 of 57 entries</div></div><div class="col-sm-6"><div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
                                	{!! $data -> appends($request) -> render() !!}
                                </div></div></div></div>
                            </div>
                           
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
@endsection
@section('classified')
<script src="/adminassets/goodsindexjs/goodsreviews.js"></script>
@endsection